Skip to content

fix: align applied Supabase migration history#552

Merged
BigSimmo merged 4 commits into
mainfrom
codex/live-migration-history-alignment
Jul 13, 2026
Merged

fix: align applied Supabase migration history#552
BigSimmo merged 4 commits into
mainfrom
codex/live-migration-history-alignment

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • align four migration filenames with the exact versions recorded by the live Supabase migration API
  • keep service_role access revoked from the legacy unfenced generation-commit overload
  • harden enrichment requests with job-first locking, conflict-safe job creation, and complete reset metadata cleanup
  • regenerate the drift manifest and record the completed live apply

Live state

Applied migrations:

  • 20260713062107_restore_text_fallback_lexical_score
  • 20260713062125_fence_index_generation_commit
  • 20260713062132_purge_expired_rag_response_cache
  • 20260713062139_route_enrichment_through_agent

Direct live assertions previously confirmed zero duplicate open-ingestion groups, zero active ingestion/enrichment overlap, the fenced overload executable by service_role, and the legacy overload inaccessible.

Verification

  • Ran npm test -- --run tests/supabase-schema.test.ts: 45/45 passed on the final review-fix commit.
  • Ran npm run drift:manifest: scratch PostgreSQL schema replay passed and regenerated the manifest.
  • Ran git diff --check: passed.
  • Previously ran Docker migration/schema replay: passed.
  • Previously ran focused concurrency/retrieval Vitest: 166/166 passed.
  • Previously ran offline RAG: 36 fixtures and 60/60 contract tests passed.
  • Previously ran npm run check:drift after the recorded live apply: passed.
  • Previously ran npm run check:production-readiness: READY.

Clinical governance

This PR aligns already-applied production migration history and hardens indexing concurrency. It does not change clinical answer policy or source-governance thresholds.

Context

PR #540 was squash-merged while post-apply verification was running. This follow-up contains the production-history alignment and the scoped enrichment concurrency fixes requested in review.

Record the generated production migration versions and keep the legacy unfenced commit overload unavailable to service_role. Regenerated drift state and verified live drift, readiness, concurrency, and retrieval contracts.
@supabase

supabase Bot commented Jul 13, 2026

Copy link
Copy Markdown

Updates to Preview Branch (codex/live-migration-history-alignment) ↗︎

Deployments Status Updated
Database Mon, 13 Jul 2026 08:07:38 UTC
Services Mon, 13 Jul 2026 08:07:38 UTC
APIs Mon, 13 Jul 2026 08:07:38 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Mon, 13 Jul 2026 08:07:39 UTC
Migrations Mon, 13 Jul 2026 08:07:41 UTC
Seeding Mon, 13 Jul 2026 08:07:43 UTC
Edge Functions Mon, 13 Jul 2026 08:07:43 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Four migrations update lexical retrieval, lease-fenced indexing commits, enrichment job processing, and scheduled RAG cache cleanup. Schema permissions, privilege tests, drift metadata, and rollout documentation reflect the applied remediation state.

Changes

Retrieval and indexing remediation

Layer / File(s) Summary
Restore lexical retrieval fallback
supabase/migrations/20260713062107_restore_text_fallback_lexical_score.sql
Recreates lexical chunk matching with full-text ranking, zero vector similarity, capped lexical scores, and explicit execution grants.
Fence index-generation commits
supabase/migrations/20260713062125_fence_index_generation_commit.sql, supabase/schema.sql, supabase/drift-manifest.json, tests/supabase-schema.test.ts
Validates ingestion worker leases before committing generations and updates the legacy overload’s service-role privilege and drift expectations.
Route enrichment through agent jobs
supabase/migrations/20260713062139_route_enrichment_through_agent.sql, supabase/schema.sql, tests/supabase-schema.test.ts
Uses conflict-safe job creation and locking, rejects already-processing jobs, clears attempt metadata, and validates the SQL shape.
Schedule cache cleanup and record rollout
supabase/migrations/20260713062132_purge_expired_rag_response_cache.sql, supabase/drift-manifest.json, docs/forward-codify-retrieval-rpcs-workorder.md, docs/branch-review-ledger.md
Adds restricted expired-cache purging with a conditional daily cron job and records the completed live migration rollout, verification results, and refreshed drift metadata.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant EnrichmentRequester
  participant request_indexing_v3_enrichment
  participant indexing_v3_agent_jobs
  EnrichmentRequester->>request_indexing_v3_enrichment: request enrichment
  request_indexing_v3_enrichment->>indexing_v3_agent_jobs: insert or lock job and read status
  indexing_v3_agent_jobs-->>request_indexing_v3_enrichment: return job status
  request_indexing_v3_enrichment-->>EnrichmentRequester: accept pending request or raise enrichment_active
Loading

Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (2 errors, 1 warning)

Check name Status Explanation Resolution
Verification Claims ❌ Error Generated notes still say Vitest/offline RAG/live probes “passed” without exact command/result wording, so the verification-claim rule isn’t met. Rewrite each verification claim as an explicit command/check plus result, e.g. “Ran npm run check:drift: passed” or “Not run: reason”; avoid generic “passed” statements.
Risky Git Or Deployment Actions ❌ Error docs/forward-codify-retrieval-rpcs-workorder.md still contains imperative live-apply steps (84-87) without an explicit confirmation gate. Convert the procedure to historical notes or remove the apply/remove steps; if guidance stays, add a clear approval/confirmation checkpoint before any live deploy.
Description check ⚠️ Warning The description covers the change and testing, but it omits the template's required checkbox-style verification and governance items. Add the template's verification checkboxes and Clinical Governance Preflight items, including the required Supabase/ingestion safeguards and any remaining notes.
✅ Passed checks (8 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Generated And Sensitive Files ✅ Passed Changed files are docs/SQL/tests plus an intentionally tracked drift manifest; no keys, .env files, logs, dumps, or other local artifacts found.
Supabase Project And Schema Safety ✅ Passed Touched docs use the canonical sjrfecxgysukkwxsowpy ref, and the DB changes are guarded security-definer/ACL updates with documented live verification.
Runtime And Package Manager Integrity ✅ Passed PR only touches docs, migrations, schema, and tests; no package-manager, lockfile, engine-strict, or Node/npm version settings were changed.
Api Route Failure Handling ✅ Passed The touched search/ingestion RPCs add deterministic guards (P0001 exceptions, FOR UPDATE/skip locked, cron namespace check, bounded limits), so no unsafe failure path was introduced.
Title check ✅ Passed The title is concise and accurately summarizes the main change: aligning Supabase migration history.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/live-migration-history-alignment
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/live-migration-history-alignment

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 13, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@supabase/migrations/20260713062139_route_enrichment_through_agent.sql`:
- Around line 56-66: Update the metadata cleanup in the document reset statement
to also remove indexing_v3_agent_attempt_count and
indexing_v3_agent_max_attempts, alongside the existing lock, error, and
scheduling fields. Keep the pending status fields and updated_at assignment
unchanged.
- Around line 13-16: Update request_indexing_v3_enrichment so it acquires locks
in the same order as claim_indexing_v3_agent_jobs: lock the relevant
indexing_v3_agent_jobs row before locking or updating the public.documents row.
Preserve the existing document ownership, ID, and indexed-status checks while
eliminating the document-first lock order.
- Around line 41-54: Update the v_job_id creation branch in the enrichment RPC
to make the indexing_v3_agent_jobs insert conflict-safe: add ON CONFLICT
(document_id) DO NOTHING, then read the existing row id when the insert does not
create one. Preserve the enrichment_active behavior by checking the resulting
job’s status and returning that error for an already-processing job instead of
propagating a 23505 uniqueness failure.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e940efe9-d395-406c-8c5d-a5a9def311c5

📥 Commits

Reviewing files that changed from the base of the PR and between 4973566 and 836a54e.

📒 Files selected for processing (9)
  • docs/branch-review-ledger.md
  • docs/forward-codify-retrieval-rpcs-workorder.md
  • supabase/drift-manifest.json
  • supabase/migrations/20260713062107_restore_text_fallback_lexical_score.sql
  • supabase/migrations/20260713062125_fence_index_generation_commit.sql
  • supabase/migrations/20260713062132_purge_expired_rag_response_cache.sql
  • supabase/migrations/20260713062139_route_enrichment_through_agent.sql
  • supabase/schema.sql
  • tests/supabase-schema.test.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@supabase/migrations/20260713062139_route_enrichment_through_agent.sql`:
- Around line 56-66: Update the metadata cleanup in the document reset statement
to also remove indexing_v3_agent_attempt_count and
indexing_v3_agent_max_attempts, alongside the existing lock, error, and
scheduling fields. Keep the pending status fields and updated_at assignment
unchanged.
- Around line 13-16: Update request_indexing_v3_enrichment so it acquires locks
in the same order as claim_indexing_v3_agent_jobs: lock the relevant
indexing_v3_agent_jobs row before locking or updating the public.documents row.
Preserve the existing document ownership, ID, and indexed-status checks while
eliminating the document-first lock order.
- Around line 41-54: Update the v_job_id creation branch in the enrichment RPC
to make the indexing_v3_agent_jobs insert conflict-safe: add ON CONFLICT
(document_id) DO NOTHING, then read the existing row id when the insert does not
create one. Preserve the enrichment_active behavior by checking the resulting
job’s status and returning that error for an already-processing job instead of
propagating a 23505 uniqueness failure.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e940efe9-d395-406c-8c5d-a5a9def311c5

📥 Commits

Reviewing files that changed from the base of the PR and between 4973566 and 836a54e.

📒 Files selected for processing (9)
  • docs/branch-review-ledger.md
  • docs/forward-codify-retrieval-rpcs-workorder.md
  • supabase/drift-manifest.json
  • supabase/migrations/20260713062107_restore_text_fallback_lexical_score.sql
  • supabase/migrations/20260713062125_fence_index_generation_commit.sql
  • supabase/migrations/20260713062132_purge_expired_rag_response_cache.sql
  • supabase/migrations/20260713062139_route_enrichment_through_agent.sql
  • supabase/schema.sql
  • tests/supabase-schema.test.ts
🛑 Comments failed to post (3)
supabase/migrations/20260713062139_route_enrichment_through_agent.sql (3)

13-16: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

git status --short
git ls-files supabase/migrations/20260713062139_route_enrichment_through_agent.sql
ast-grep outline supabase/migrations/20260713062139_route_enrichment_through_agent.sql --view expanded
sed -n '1,220p' supabase/migrations/20260713062139_route_enrichment_through_agent.sql

Repository: BigSimmo/Database

Length of output: 6782


🏁 Script executed:

#!/bin/bash
set -euo pipefail

nl -ba supabase/migrations/20260713062139_route_enrichment_through_agent.sql | sed -n '1,220p' | sed -n '1,180p'

Repository: BigSimmo/Database

Length of output: 195


🏁 Script executed:

#!/bin/bash
set -euo pipefail

awk '{printf "%4d  %s\n", NR, $0}' supabase/migrations/20260713062139_route_enrichment_through_agent.sql | sed -n '1,180p'

Repository: BigSimmo/Database

Length of output: 7688


Keep document/job lock order consistent to avoid deadlocks.

request_indexing_v3_enrichment locks the document row before touching indexing_v3_agent_jobs, while claim_indexing_v3_agent_jobs locks the job row first and only then updates the document row. If both run against the same document at the same time, Postgres can end up with a circular wait and abort one transaction.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@supabase/migrations/20260713062139_route_enrichment_through_agent.sql` around
lines 13 - 16, Update request_indexing_v3_enrichment so it acquires locks in the
same order as claim_indexing_v3_agent_jobs: lock the relevant
indexing_v3_agent_jobs row before locking or updating the public.documents row.
Preserve the existing document ownership, ID, and indexed-status checks while
eliminating the document-first lock order.

41-54: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== target migration excerpt ==\n'
sed -n '1,140p' supabase/migrations/20260713062139_route_enrichment_through_agent.sql

printf '\n== claim function excerpt ==\n'
rg -n -A80 -B20 'claim_indexing_v3_agent_jobs' supabase/migrations

printf '\n== unique index / constraint references ==\n'
rg -n 'indexing_v3_agent_jobs_document_id_idx|UNIQUE INDEX .*indexing_v3_agent_jobs|create unique index .*indexing_v3_agent_jobs' supabase -S

printf '\n== any triggers or locks on documents / agent jobs ==\n'
rg -n 'FOR UPDATE|lock.*documents|indexing_v3_agent_jobs' supabase/migrations -S

Repository: BigSimmo/Database

Length of output: 50374


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== metadata key usage ==\n'
rg -n 'indexing_v3_agent_attempt_count|indexing_v3_agent_max_attempts' supabase -S

printf '\n== job row writes/reads around request/claim status ==\n'
rg -n 'attempt_count|max_attempts|enrichment_status|indexing_v3_agent_status' supabase/migrations/20260713062139_route_enrichment_through_agent.sql supabase/migrations/20260702190000_indexing_v3_agent_jobs_table.sql -n -S

Repository: BigSimmo/Database

Length of output: 12971


Avoid the concurrent insert race here

public.indexing_v3_agent_jobs.document_id is unique, and the FOR UPDATE on documents doesn’t protect this insert. A concurrent claim_indexing_v3_agent_jobs insert can still win and make this RPC fail with 23505 instead of returning enrichment_active; add ON CONFLICT (document_id) DO NOTHING and read back the existing row id.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@supabase/migrations/20260713062139_route_enrichment_through_agent.sql` around
lines 41 - 54, Update the v_job_id creation branch in the enrichment RPC to make
the indexing_v3_agent_jobs insert conflict-safe: add ON CONFLICT (document_id)
DO NOTHING, then read the existing row id when the insert does not create one.
Preserve the enrichment_active behavior by checking the resulting job’s status
and returning that error for an already-processing job instead of propagating a
23505 uniqueness failure.

56-66: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Reset doesn't clear stale indexing_v3_agent_attempt_count/_max_attempts from document metadata.

claim_indexing_v3_agent_jobs writes indexing_v3_agent_attempt_count and indexing_v3_agent_max_attempts into documents.metadata (lines 143-144 below) whenever a job is claimed. This reset only strips _locked_by, _locked_at, _last_error, _next_run_at, so after a user-triggered reset the document metadata can still show a stale attempt count from the prior cycle even though the job row's attempt_count was reset to 0.

🛠️ Proposed fix
   update public.documents
   set metadata = (coalesce(metadata, '{}'::jsonb)
       - 'indexing_v3_agent_locked_by' - 'indexing_v3_agent_locked_at'
-      - 'indexing_v3_agent_last_error' - 'indexing_v3_agent_next_run_at')
+      - 'indexing_v3_agent_last_error' - 'indexing_v3_agent_next_run_at'
+      - 'indexing_v3_agent_attempt_count' - 'indexing_v3_agent_max_attempts')
       || jsonb_build_object(
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

  update public.documents
  set metadata = (coalesce(metadata, '{}'::jsonb)
      - 'indexing_v3_agent_locked_by' - 'indexing_v3_agent_locked_at'
      - 'indexing_v3_agent_last_error' - 'indexing_v3_agent_next_run_at'
      - 'indexing_v3_agent_attempt_count' - 'indexing_v3_agent_max_attempts')
      || jsonb_build_object(
        'enrichment_status', 'pending',
        'indexing_v3_agent_status', 'pending',
        'indexing_v3_agent_updated_at', now()
      ),
      updated_at = now()
  where id = p_document_id and owner_id = p_owner_id;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@supabase/migrations/20260713062139_route_enrichment_through_agent.sql` around
lines 56 - 66, Update the metadata cleanup in the document reset statement to
also remove indexing_v3_agent_attempt_count and indexing_v3_agent_max_attempts,
alongside the existing lock, error, and scheduling fields. Keep the pending
status fields and updated_at assignment unchanged.

@BigSimmo

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts on this branch.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 13, 2026 06:56
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found.

…history-alignment

# Conflicts:
#	docs/branch-review-ledger.md
auto-merge was automatically disabled July 13, 2026 06:58

Head branch was pushed to by a user without write access

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

Done — the only conflict was in docs/branch-review-ledger.md where both branches had appended a new ledger row at the same position. Both rows are retained in the merge commit (8c656ea).

@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex fix all issues on this PR including comments

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex couldn't complete this request. Try again later.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 13, 2026 07:03
@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex fix failing CI testing

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • git diff --check
  • ⚠️ npm run test -- tests/supabase-schema.test.ts — could not run successfully in this environment because node resolves to v20.20.2 and node_modules/vitest/vitest.mjs is missing, while this repo requires Node 24/npm 11.

View task →

@BigSimmo

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts on this branch.

@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex fix all issues, comments and failing CI testing

…history-alignment

# Conflicts:
#	supabase/drift-manifest.json
auto-merge was automatically disabled July 13, 2026 08:00

Head branch was pushed to by a user without write access

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

Done — the only conflict was in supabase/drift-manifest.json (both branches updated the schema replay metadata). The main branch version was used since it's the more recent regeneration. Merge commit: 39c81a6.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 13, 2026 08:03
@BigSimmo
BigSimmo dismissed coderabbitai[bot]’s stale review July 13, 2026 08:07

All three actionable concurrency/reset findings were fixed in 9ed693e, mirrored in schema.sql, covered by focused tests, and the verification claims were rewritten as explicit command/result pairs.

@BigSimmo

Copy link
Copy Markdown
Owner Author

Resolved the requested changes in 9ed693e9: job-first locking, ON CONFLICT (document_id) DO NOTHING with locked readback, processing-state preservation, stale attempt/max-attempt metadata cleanup, schema parity, regenerated drift manifest, and explicit verification wording. Focused schema tests pass 45/45 and scratch PostgreSQL replay passes.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • PATH="$HOME/.nvm/versions/node/v24.15.0/bin:$PATH" npm ci
  • PATH="$HOME/.nvm/versions/node/v24.15.0/bin:$PATH" npm run test -- tests/supabase-schema.test.ts
  • PATH="$HOME/.nvm/versions/node/v24.15.0/bin:$PATH" npm run test -- tests/drift-detection.test.ts tests/supabase-schema.test.ts
  • git diff --check
  • PATH="$HOME/.nvm/versions/node/v24.15.0/bin:$PATH" npm run verify:cheap
  • ⚠️ npm run drift:manifest was not run because Docker is not installed in this environment.

View task →

@BigSimmo
BigSimmo merged commit 1237774 into main Jul 13, 2026
14 of 15 checks passed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/forward-codify-retrieval-rpcs-workorder.md`:
- Around line 3-6: Update the execution procedure in Steps 1–7 to clearly
indicate it is historical and already completed, or replace those instructions
with the recorded migration completion evidence. Remove stale imperative
guidance telling operators to apply the migrations or remove allowlist entries,
while preserving the documented applied migration versions and validation
results.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 32e746a7-d1d0-44d4-aa73-ed00fb7b06ff

📥 Commits

Reviewing files that changed from the base of the PR and between 39c81a6 and 9ed693e.

📒 Files selected for processing (6)
  • docs/branch-review-ledger.md
  • docs/forward-codify-retrieval-rpcs-workorder.md
  • supabase/drift-manifest.json
  • supabase/migrations/20260713062139_route_enrichment_through_agent.sql
  • supabase/schema.sql
  • tests/supabase-schema.test.ts

Comment on lines +3 to +6
**Status: complete.** The production-current definitions were captured read-only and preserved under
their actual migration versions. Ran the scratch PostgreSQL replay: passed. Ran the reviewed live
migration apply: applied `20260713062107`, `20260713062125`, `20260713062132`, and `20260713062139`
on 2026-07-13. Ran `npm run check:drift`: passed. Ran `npm run check:production-readiness`: READY.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Mark the execution procedure as completed or historical.

The status now says the migrations were applied on July 13, 2026, but the later procedure still tells operators to apply them and remove the allowlist entries. That stale imperative text can cause a future operator to repeat an already-completed live migration workflow. Mark Steps 1–7 as historical or replace them with the recorded completion evidence.

🧰 Tools
🪛 LanguageTool

[style] ~6-~6: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...-13. Ran npm run check:drift: passed. Ran npm run check:production-readiness: R...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/forward-codify-retrieval-rpcs-workorder.md` around lines 3 - 6, Update
the execution procedure in Steps 1–7 to clearly indicate it is historical and
already completed, or replace those instructions with the recorded migration
completion evidence. Remove stale imperative guidance telling operators to apply
the migrations or remove allowlist entries, while preserving the documented
applied migration versions and validation results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants